#!/bin/bash

d=$(date -d "-1 day" +%Y%m%d)

if [[ $# -eq 1 ]];then
	d=$1
fi

#echo $d
while [[ $d -le 20150426 ]];do
	echo "***********$(date +"%Y%m%d %H:%M:%S")************"
	echo $d
	sh run_etl.sh $d
	#sh run_statistic.sh $d
	#sh run_intomysql.sh $d
	echo "***********$(date +"%Y%m%d %H:%M:%S")************"
	d=$(date +"%Y%m%d" -d "+1 day $d")
done
